package com.rivulet.doj_backend.judger.manager;

import com.rivulet.doj_backend.judger.judging.JudgeNumTwoThread;
import com.rivulet.doj_backend.pojo.JudgeParameter;

import java.util.concurrent.*;

/**
 * {管理层}
 *
 * @author xujiac
 * @create 2021/4/29
 * @since 1.0.0
 */
public class TaskManager{
    private static final ExecutorService ThreadPool=Executors.newFixedThreadPool(100);
    public static void main(String[] args) {
        String java="import java.util.Scanner;\n" +
                "public class Main {\n" +
                "    public static void main(String[] args) {\n" +
                "        Scanner key=new Scanner(System.in);\n" +
                "        String str1=key.next();\n" +
                "        String str2=key.next();\n" +
                "        System.out.println(\"结果：\"+str1+str2);\n" +
                "        key.close();\n" +
                "    }\n" +
                "}\n";
        JudgeParameter parameter=new JudgeParameter(1,java,"java",new String[] {"1 1","2 2","3 3","4 4","5 5"});
        new TaskManager().manage(parameter);
    }
    public void manage(JudgeParameter parameter){
        ThreadPool.execute(new JudgeNumTwoThread(parameter));
    }
}
